package cc.wsyw126.java.nowcoder.offer360;

import java.util.Collection;
import java.util.HashMap;
import java.util.Scanner;

/**
 * Created by dp on 17/3/25.
 */
public class Q2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        int len = s.length();
        int count = 0;
        for (int i = 0; i < len; i++) {
            HashMap<String, Integer> stringIntegerHashMap = new HashMap<>();
            stringIntegerHashMap.put(String.valueOf(s.charAt(i)), 1);
            for (int j = i + 1; j < len; j++) {
                Integer integer = stringIntegerHashMap.get(String.valueOf(s.charAt(j)));
                if (integer == null || integer == 0) {
                    stringIntegerHashMap.put(String.valueOf(s.charAt(j)), 1);
                } else {
                    stringIntegerHashMap.put(String.valueOf(s.charAt(j)), 0);
                }
                Collection<Integer> values = stringIntegerHashMap.values();
                if (!values.contains(1)) {
                    count++;
                }
            }
        }
        System.out.println(count);
    }

}
